/**
 * Created with IntelliJ IDEA.
 * User: Administrator
 * Date: 13-6-21
 * Time: 下午7:42
 * To change this template use File | Settings | File Templates.
 */
(function ($) {
    //中文combobox  bug问题
    $.fn.zwcomboboxbug = function () {
        var combo_text = this.data("combo").combo.find(".combo-text");
        var options = this.combobox("options");
        var varthis = this;
        combo_text.unbind("keypress").keyup(function (e) {
            if (!isOtherKey(e)) {
                options.keyHandler.query.call(varthis[0], combo_text.val())
            }
        });
    }

    //中文combogrid  bug问题
    $.fn.zwcombogridbug = function (e) {
        var combo_text = this.data("combo").combo.find(".combo-text");
        var options = this.combogrid("options");
        var varthis = this;
        combo_text.unbind("keypress").keyup(function (e) {
            if (!isOtherKey(e)) {
                options.keyHandler.query.call(varthis[0], combo_text.val());
            };
        });
    }

    //判断是否其他的key
    function isOtherKey(e) {
        return $.inArray(e.which, [13,38,40]) != -1;
    }
})(jQuery)